package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsArticleCategoryDTO;
import com.xindacloud.sms.console.system.entity.SmsArticleCategory;
import com.xindacloud.sms.console.system.service.ISmsArticleCategoryService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-10-16
 */
@Api(tags = {"网站文章分类模块"})
@RestController
@RequestMapping("/api/v1/sms-article-category")
public class SmsArticleCategoryController {
	
	@Autowired
	private ISmsArticleCategoryService smsArticleCategoryService;
	
	@ApiOperation(value = "获取文章分类列表",response=SmsArticleCategory.class)
	@PostMapping(value = "/getSmsArticleCategoryList")
	public Result getSmsArticleCategoryList(@RequestBody SmsArticleCategoryDTO smsArticleCategoryDTO) {
	    return smsArticleCategoryService.getSmsArticleCategoryList(smsArticleCategoryDTO);
	}
	
	@ApiOperation(value = "保存或修改文章分类")
	@PostMapping(value = "/saveOrUpdateSmsArticleCategory")
	public Result saveOrUpdateSmsArticleCategory(@RequestBody SmsArticleCategoryDTO smsArticleCategoryDTO) {
	    return smsArticleCategoryService.saveOrUpdateSmsArticleCategory(smsArticleCategoryDTO);
	}
	
	@ApiOperation(value = "删除文章分类")
	@PostMapping(value = "/deleteSmsArticleCategory")
	public Result deleteSmsArticleCategory(@RequestBody SmsArticleCategoryDTO smsArticleCategoryDTO) {
	    return smsArticleCategoryService.deleteSmsArticleCategory(smsArticleCategoryDTO);
	}
	

}
